﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Library.OrmEnterpriseEntity {
	/// <summary>
	/// Relation mapping
	/// </summary>
	public struct RelationView {
		private readonly string _name;
		private readonly RelationDetailView[] _detail;
		private GlobalEntityView _tableView;
		private GlobalEntityView _parentTableView;
		/// <summary>
		/// 
		/// </summary>
		public RelationView(string name, int detailCount) {
			_name = name;
			_detail = new RelationDetailView[detailCount];
			_tableView = null;
			_parentTableView = null;
		}
		/// <summary>
		/// Name of relation
		/// </summary>
		public string Name { get { return _name; } }
		/// <summary>
		/// Detail of relation
		/// </summary>
		public RelationDetailView[] Details { get { return _detail; } }


		/// <summary>
		/// Table in relation
		/// </summary>
		public GlobalEntityView TableView { get { return _tableView; } set { _tableView = value; } }
		/// <summary>
		/// Parent table in relation
		/// </summary>
		public GlobalEntityView ParentTableView { get { return _parentTableView; } set { _parentTableView = value; } }
	}
}
